00001 #ifndef TCPSOCKET_H_
00002 #define TCPSOCKET_H_
00003
00004 #ifdef WIN32
00005 #include <Winsock2.h>
00006 #else
00007 #include <arpa/inet.h>
00008 #endif
00009
00016 class TCPSocket
00017 {
00018 private:
00019 #ifdef WIN32
00020 SOCKET fileDescriptor;
00021 #else
00022 int fileDescriptor;
00023 #endif
00024 public:
00025 TCPSocket();
00026 bool connect(unsigned short port, unsigned long address);
00027 bool send(char *sendingMessage);
00028 bool select(int seconds, int microseconds);
00029 bool receive(char *receivingMessage, int receivingMessageSize);
00030 virtual ~TCPSocket();
00031 };
00032
00033 #endif